#pragma ident "$Id: Edge.cpp $"

/**
 * @file Edge.cpp
 * Class to define and handle the edge of observation graph.
 */

//============================================================================
//
//  Shoujian Zhang - School of Geodesy and Geomatics, Wuhan University, 2011
//
//============================================================================

#include <set>
#include <map>
#include <list>
#include <queue>
#include <vector>

#include "Edge.hpp"


namespace gpstk
{


    /// Assignment operator.
    Edge& Edge::operator=(const Edge& right)
        throw()
    {
        if ( this == &right )
        {
            return (*this);
        }
        Variable::operator=(right);
        edgeVar     = right.getVar();

        return (*this);
    }


    /// This ordering is required to be able
    /// to use a Edge as an index to a std::map, or as part of a
    /// std::set. The edges are ordered by its variance firstly,
    /// then the arc
    bool Edge::operator<(const Edge& right) const
    {
        if( edgeVar == right.getVar() )
        {
            return Variable::operator<(right);
        }
        else
        {
            return ( edgeVar < right.getVar() );
        }
    }

}  // End of namespace gpstk
